package com.smfx.yxt.excel;

import java.util.HashMap;
import java.util.Map;

import org.apache.commons.jexl2.Expression;
import org.apache.commons.jexl2.JexlContext;
import org.apache.commons.jexl2.JexlEngine;
import org.apache.commons.jexl2.MapContext;

public class ExcelValueStack {
    private static JexlEngine jexl = new JexlEngine();
    static {
        Map<String, Object> functions = new HashMap<String, Object>();
        //functions.put("issUtils", InvestScoreSourceUtil.class);
        jexl.setFunctions(functions);
    }

    private JexlContext jc = new MapContext();

    public Object findValue(String expression) {
        Expression e = jexl.createExpression(expression);
        return e.evaluate(jc);

    }

    public void set(String key, Object value) {
        jc.set(key, value);
    }
}
